<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交网站导航样式示例</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --primary: #4263eb;
            --primary-light: #748ffc;
            --secondary: #1098ad;
            --dark: #212529;
            --light: #f8f9fa;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --danger: #e74c3c;
            --success: #2ecc71;
            --warning: #f39c12;
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            padding-top: 20px;
        }
        
        .section-title {
            margin: 40px 0 25px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--primary-light);
        }
        
        .nav-example {
            margin-bottom: 40px;
            padding: 20px;
            border-radius: 8px;
            background-color: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }
        
        .nav-description {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px dashed var(--light-gray);
            font-size: 0.95rem;
            color: var(--gray);
        }
        
        /* 自定义导航样式 */
        .navbar-custom {
            background-color: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        .sidebar-nav {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 15px 0;
        }
        
        .sidebar-nav .nav-link {
            padding: 10px 20px;
            color: var(--dark);
            transition: var(--transition);
        }
        
        .sidebar-nav .nav-link:hover,
        .sidebar-nav .nav-link.active {
            color: var(--primary);
            background-color: rgba(66, 99, 235, 0.05);
        }
        
        .sidebar-nav .nav-link i {
            width: 20px;
            margin-right: 10px;
        }
        
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
            z-index: 1030;
        }
        
        .bottom-nav .nav-link {
            color: var(--gray);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px;
            transition: var(--transition);
        }
        
        .bottom-nav .nav-link.active {
            color: var(--primary);
        }
        
        .bottom-nav .nav-link i {
            font-size: 1.2rem;
            margin-bottom: 5px;
        }
        
        .bottom-nav .nav-link span {
            font-size: 0.75rem;
        }
        
        .profile-nav .nav-link {
            padding: 12px 15px;
            color: var(--dark);
            border-bottom: 1px solid var(--light-gray);
        }
        
        .profile-nav .nav-link:last-child {
            border-bottom: none;
        }
        
        .profile-nav .nav-link:hover {
            background-color: var(--light);
        }
        
        .profile-nav .nav-link.active {
            color: var(--primary);
            background-color: rgba(66, 99, 235, 0.05);
            border-left: 3px solid var(--primary);
        }
        
        /* 通知徽章 */
        .badge-notification {
            position: relative;
        }
        
        .badge-notification .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            border-radius: 50%;
            padding: 2px 6px;
            font-size: 0.7rem;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="text-center mb-5">社交网站导航样式集合</h1>
        
        <!-- 1. 顶部主导航 -->
        <div class="nav-example">
            <h2 class="section-title">1. 顶部主导航</h2>
            <nav class="navbar navbar-expand-lg navbar-custom">
                <div class="container-fluid">
                    <a class="navbar-brand d-flex align-items-center" href="#">
                        <i class="fas fa-connectdevelop text-primary me-2"></i>
                        <span>社交圈</span>
                    </a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                    <div class="collapse navbar-collapse" id="mainNav">
                        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                            <li class="nav-item">
                                <a class="nav-link active" aria-current="page" href="#">
                                    <i class="fas fa-home me-1"></i> 首页
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-user-friends me-1"></i> 朋友
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-compass me-1"></i> 发现
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-th-large me-1"></i> 群组
                                </a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                                    <i class="fas fa-bell me-1 badge-notification">
                                        <span class="badge bg-danger">3</span>
                                    </i> 通知
                                </a>
                                <ul class="dropdown-menu dropdown-menu-end">
                                    <li><a class="dropdown-item" href="#">新的好友请求 (2)</a></li>
                                    <li><a class="dropdown-item" href="#">有人评论了你的动态</a></li>
                                    <li><hr class="dropdown-divider"></li>
                                    <li><a class="dropdown-item" href="#">查看全部通知</a></li>
                                </ul>
                            </li>
                        </ul>
                        <div class="d-flex align-items-center gap-3">
                            <div class="dropdown">
                                <button class="btn btn-outline-none dropdown-toggle" type="button" data-bs-toggle="dropdown">
                                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="rounded-circle" width="36" height="36">
                                </button>
                                <ul class="dropdown-menu dropdown-menu-end">
                                    <li><a class="dropdown-item" href="#">个人主页</a></li>
                                    <li><a class="dropdown-item" href="#">设置</a></li>
                                    <li><hr class="dropdown-divider"></li>
                                    <li><a class="dropdown-item" href="#">退出登录</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </nav>
            <div class="nav-description">
                <p>标准的顶部导航栏，包含品牌标识、主要导航链接、通知中心和用户菜单，适合大多数社交网站的桌面端布局。</p>
                <p>特点：响应式设计，在移动设备上转为汉堡菜单；通知带有未读数量标记；支持下拉菜单。</p>
            </div>
        </div>
        
        <!-- 2. 侧边栏导航 -->
        <div class="nav-example">
            <h2 class="section-title">2. 侧边栏导航</h2>
            <div class="row">
                <div class="col-md-3">
                    <div class="sidebar-nav">
                        <ul class="nav flex-column">
                            <li class="nav-item">
                                <a class="nav-link active" href="#">
                                    <i class="fas fa-home"></i> 首页
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-user"></i> 个人资料
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-users"></i> 我的好友
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-comments"></i> 消息
                                    <span class="badge bg-primary ms-2">5</span>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-bookmark"></i> 收藏
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-calendar-alt"></i> 活动
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-cog"></i> 设置
                                </a>
                            </li>
                            <li class="nav-item mt-3">
                                <a class="nav-link text-danger" href="#">
                                    <i class="fas fa-sign-out-alt"></i> 退出
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="p-3 bg-light rounded h-100">
                        <h5>主内容区域</h5>
                        <p>这里是侧边栏导航对应的主内容展示区域，适合需要展示较多内容的社交平台布局。</p>
                    </div>
                </div>
            </div>
            <div class="nav-description">
                <p>侧边栏导航布局，适合内容较为丰富的社交平台，能够提供更多的导航选项而不占用顶部空间。</p>
                <p>特点：图标与文字结合的导航项；支持徽章显示未读数量；有明确的视觉层次和交互反馈。</p>
            </div>
        </div>
        
        <!-- 3. 移动端底部导航 -->
        <div class="nav-example">
            <h2 class="section-title">3. 移动端底部导航</h2>
            <div class="d-block d-md-none">
                <!-- 模拟移动设备视图 -->
                <div style="max-width: 375px; margin: 0 auto; border: 1px solid #ddd; border-radius: 20px; overflow: hidden; position: relative; height: 500px;">
                    <div style="height: calc(100% - 60px); overflow-y: auto; padding: 15px;">
                        <h5 class="mb-3">移动端内容区域</h5>
                        <p>这是移动端应用的主内容展示区，底部导航固定在屏幕底部，方便用户单手操作。</p>
                        <p class="text-muted">向下滚动查看更多内容...</p>
                        <div style="height: 800px;"></div>
                    </div>
                    <!-- 底部导航 -->
                    <nav class="bottom-nav">
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-2">
                                    <a class="nav-link active" href="#">
                                        <i class="fas fa-home"></i>
                                        <span>首页</span>
                                    </a>
                                </div>
                                <div class="col-2">
                                    <a class="nav-link" href="#">
                                        <i class="fas fa-compass"></i>
                                        <span>发现</span>
                                    </a>
                                </div>
                                <div class="col-2">
                                    <a class="nav-link" href="#">
                                        <i class="fas fa-plus-circle"></i>
                                        <span>发布</span>
                                    </a>
                                </div>
                                <div class="col-2">
                                    <a class="nav-link" href="#">
                                        <i class="fas fa-bell badge-notification">
                                            <span class="badge bg-danger">2</span>
                                        </i>
                                        <span>通知</span>
                                    </a>
                                </div>
                                <div class="col-2">
                                    <a class="nav-link" href="#">
                                        <i class="fas fa-user"></i>
                                        <span>我的</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
            <div class="d-none d-md-block alert alert-info mt-3">
                移动端底部导航在桌面视图中隐藏，仅在移动设备上显示。
            </div>
            <div class="nav-description">
                <p>专为移动设备优化的底部导航栏，适合单手操作，是移动社交应用的常见导航模式。</p>
                <p>特点：固定在屏幕底部；图标与文字结合；中间按钮通常用于主要操作（如发布内容）；支持未读标记。</p>
            </div>
        </div>
        
        <!-- 4. 个人资料页导航 -->
        <div class="nav-example">
            <h2 class="section-title">4. 个人资料页导航</h2>
            <div class="row">
                <div class="col-md-3">
                    <div class="text-center mb-4">
                        <img src="https://picsum.photos/id/64/120/120" alt="用户头像" class="rounded-circle mb-3" width="120" height="120">
                        <h4>张明</h4>
                        <p class="text-muted">@zhangming</p>
                    </div>
                    <div class="profile-nav">
                        <ul class="nav flex-column">
                            <li class="nav-item">
                                <a class="nav-link active" href="#">
                                    <i class="fas fa-user me-2"></i> 个人主页
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-images me-2"></i> 我的相册
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-comment-alt me-2"></i> 我的动态
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-heart me-2"></i> 我的收藏
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-users me-2"></i> 我的好友
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-cog me-2"></i> 资料设置
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="p-4 bg-light rounded h-100">
                        <h5>个人主页内容</h5>
                        <p>这里是用户个人主页的内容展示区域，包括动态、照片、个人信息等。</p>
                    </div>
                </div>
            </div>
            <div class="nav-description">
                <p>个人资料页面专用导航，帮助用户在个人相关的不同功能页面间切换。</p>
                <p>特点：与用户信息结合；突出当前所在页面；导航项与个人功能紧密相关。</p>
            </div>
        </div>
        
        <!-- 5. 群组/社区导航 -->
        <div class="nav-example">
            <h2 class="section-title">5. 群组/社区导航</h2>
            <nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom">
                <div class="container-fluid">
                    <a class="navbar-brand" href="#">摄影爱好者社区</a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#groupNav">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                    <div class="collapse navbar-collapse" id="groupNav">
                        <ul class="navbar-nav">
                            <li class="nav-item">
                                <a class="nav-link active" href="#">
                                    <i class="fas fa-home me-1"></i> 群组首页
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-images me-1"></i> 作品展示
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-comments me-1"></i> 讨论区
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-calendar-alt me-1"></i> 活动
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">
                                    <i class="fas fa-bookmark me-1"></i> 精华内容
                                </a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                                    <i class="fas fa-cog me-1"></i> 管理
                                </a>
                                <ul class="dropdown-menu dropdown-menu-end">
                                    <li><a class="dropdown-item" href="#">群组设置</a></li>
                                    <li><a class="dropdown-item" href="#">成员管理</a></li>
                                    <li><a class="dropdown-item" href="#">内容审核</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            <div class="nav-description">
                <p>适用于社交平台内特定群组或社区的导航栏，提供与该群组相关的功能入口。</p>
                <p>特点：包含群组名称；导航项与群组功能紧密相关；根据用户权限显示管理选项。</p>
            </div>
        </div>
    </div>

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 导航交互增强
        document.querySelectorAll('.nav-link').forEach(link => {
            link.addEventListener('click', function(e) {
                // 移除同组中其他链接的active类
                const parentNav = this.closest('.nav');
                if (parentNav) {
                    parentNav.querySelectorAll('.nav-link').forEach(item => {
                        item.classList.remove('active');
                    });
                }
                // 给当前点击的链接添加active类
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>
    
